package com.ry.demo.concurrent.demo;

import org.apache.commons.lang3.time.StopWatch;

import java.util.concurrent.TimeUnit;

/**
 * @Author: lihui
 * @Date: 2021-12-25 09:06
 * @Description:
 */
public class TimeDemo {

    public static void main(String[] args) {
        StopWatch watch = StopWatch.createStarted();

        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        watch.stop();

        System.out.println(watch.getTime(TimeUnit.SECONDS));
        System.out.println(watch.getTime(TimeUnit.MINUTES));
    }

}
